<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('物料编码')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-material_code" class="form-control" name="row[material_code]" type="text" value="" placeholder="留空自动生成">
        </div>
    </div>
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('物料名称')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-material_name" data-rule="required" class="form-control" name="row[material_name]" type="text" value="">
        </div>
    </div>
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('物料分类')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-category_id" data-rule="required" class="form-control selectpicker" name="row[category_id]" data-live-search="true">
                <option value="">{:__('请选择分类')}</option>
                {foreach $categoryList as $category}
                <option value="{$category.id}">{$category.name} ({$category.code})</option>
                {/foreach}
            </select>
        </div>
    </div>
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('规格型号')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-specification" class="form-control" name="row[specification]" type="text" value="">
        </div>
    </div>
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('单位')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-unit" data-rule="required" class="form-control" name="row[unit]" type="text" value="">
        </div>
    </div>
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('最小库存')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-min_stock" class="form-control" name="row[min_stock]" type="number" value="0" min="0">
        </div>
    </div>
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('最大库存')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-max_stock" class="form-control" name="row[max_stock]" type="number" value="0" min="0">
        </div>
    </div>
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('状态')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-status" class="form-control selectpicker" name="row[status]">
                <option value="1" selected>启用</option>
                <option value="0">停用</option>
            </select>
        </div>
    </div>
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('备注')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-remark" class="form-control" name="row[remark]" rows="3"></textarea>
        </div>
    </div>
    
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
